#ifndef __APP_LIB_SYSTEM_V_BASE_H__
#define __APP_LIB_SYSTEM_V_BASE_H__

#ifdef __cplusplus
extern "C" {
#endif

#define APP_LIB_SYSTEM_V_PROJECT_ID         'V'

typedef enum __APP_LIB_SYSTEM_V_TYPE_e_
{
    APP_LIB_SYSTEM_V_TYPE_MSG,
    APP_LIB_SYSTEM_V_TYPE_SHM,
    APP_LIB_SYSTEM_V_TYPE_SEM,

    APP_LIB_SYSTEM_V_TYPE_MAX,
} APP_LIB_SYSTEM_V_TYPE_e;

typedef enum __APP_LIB_SYSTEM_V_SEM_OP_e__
{
    APP_LIB_SYSTEM_V_SEM_OP_P,
    APP_LIB_SYSTEM_V_SEM_OP_P_BLOCK,
    APP_LIB_SYSTEM_V_SEM_OP_V,
    APP_LIB_SYSTEM_V_SEM_OP_V_BLOCK,

    APP_LIB_SYSTEM_V_SEM_OP_UNDO,

    APP_LIB_SYSTEM_V_SEM_OP_MAX,
} APP_LIB_SYSTEM_V_SEM_OP_e;

typedef enum __APP_LIB_SYSTEM_V_SHM_OP_e__
{
    APP_LIB_SYSTEM_V_SHM_OP_AT,
    APP_LIB_SYSTEM_V_SHM_OP_DT,

    APP_LIB_SYSTEM_V_SHM_OP_MAX,
} APP_LIB_SYSTEM_V_SHM_OP_e;

typedef struct __APP_LIB_SYSTEM_V_MSG_s__
{
    SLONG lType;
    UINT16 usLen;
    UINT8 auData[0];
} APP_LIB_SYSTEM_V_MSG_s;

extern SINT32 AppLibSystemV_Get(APP_LIB_SYSTEM_V_TYPE_e type, ...);
extern ULONG AppLibSystemV_Ctl(APP_LIB_SYSTEM_V_TYPE_e type, ...);
extern ULONG AppLibSystemV_ShmCtrl(APP_LIB_SYSTEM_V_SHM_OP_e opt, ...);
extern ULONG AppLibSystemV_SemCtrl(SINT32 iSysID, SINT32 iSemNum, APP_LIB_SYSTEM_V_SEM_OP_e opt);
extern ULONG AppLibSystemV_MsgSnd(IN SINT32 iQueueId, IN APP_LIB_SYSTEM_V_MSG_s *msg, IN SINT32 flag);
extern ULONG AppLibSystemV_MsgRcv(IN SINT32 iQueueId, INOUT APP_LIB_SYSTEM_V_MSG_s *msg, IN SINT32 flag);

#ifdef __cplusplus
}
#endif

#endif // __APP_LIB_SYSTEM_V_BASE_H__
